package com.bct.jxc.view;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Toolkit;

import javax.swing.JInternalFrame;
import javax.swing.JTabbedPane;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.InternalFrameAdapter;
import javax.swing.event.InternalFrameEvent;

import com.bct.jxc.view.user.UserAddPanel;
import com.bct.jxc.view.user.UserEditPanel;

public class UserInternalFrame extends JInternalFrame{
	/**
	 * Create the frame.
	 */
	public UserInternalFrame() {
		super("操作员信息管理",true,true,true,true);
		getContentPane().setLayout(new BorderLayout(0, 0));
		Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
		setBounds(0,0,screenSize.width*2/3,screenSize.height*2/3);
        //创建选项卡
		JTabbedPane tabPane = new JTabbedPane();
		final UserAddPanel addPanel = new UserAddPanel();//操作员信息添加面板
		final UserEditPanel editPanel = new UserEditPanel();//操作员信息编辑面板
		//向选项卡添加面板
		tabPane.addTab("添加操作员",null,addPanel,"操作员信息添加");
		//addPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
		tabPane.addTab("编辑操作员", null,editPanel,"操作员信息编辑");
		//editPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
		//向Frame窗口添加选项卡
		getContentPane().add(tabPane);
		//给选项卡设置改变监听
		tabPane.addChangeListener(new ChangeListener() {
			
			@Override
			public void stateChanged(ChangeEvent e) {
			    //初始化 编辑界面的下拉列表框
				
			}
		});
		//在操作员管理窗口被激活时，初始化操作员添加界面的供应商下拉选择框。
		addInternalFrameListener(new InternalFrameAdapter() {
			@Override
			public void internalFrameActivated(InternalFrameEvent e) {
				
			}
		});
		//pack();//通过内部组件自动设置窗口大小
		setVisible(true);//显示窗口
	}

}
